﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace navigation.Controls
{
    /// <summary>
    /// Interaction logic for SlideSwitch.xaml
    /// </summary>
    public partial class SlideSwitch : UserControl
    {
        public SlideSwitch()
        {
            InitializeComponent();
            this.btnValue = "Center";
        }

        private void surfaceSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
        {
            double i = this.surfaceSlider.Maximum / 3;
            if (this.surfaceSlider.Value < i)
                this.btnValue = "Left";
            else if (this.surfaceSlider.Value > 2 * i)
                this.btnValue = "Right";
            else
                return;
        }

        public string btnValue
        {
            get { return (string)GetValue(btnValueProperty); }
            set { SetValue(btnValueProperty, value); }
        }

        public static readonly DependencyProperty btnValueProperty =
            DependencyProperty.Register("btnValue", typeof(string), typeof(SlideSwitch), null);
       
    }
}
